Skip to content

Reject nested keys when extracting pnpm package entries#33

Merged
andrew merged 1 commit into
mainfrom
fix-pnpm-peer-deps-meta
May 22, 2026
Merged

Reject nested keys when extracting pnpm package entries#33
andrew merged 1 commit into
mainfrom
fix-pnpm-peer-deps-meta

Conversation

@andrew
Copy link
Copy Markdown
Contributor

@andrew andrew commented May 22, 2026

extractPnpmPackageKey only checked that a line started with at least two spaces, so deeper-indented scoped keys inside peerDependenciesMeta blocks were treated as top-level package entries. A line like '@typescript-eslint/parser': would slip through with its leading whitespace and quotes intact, then get split on / into name '@typescript-eslint and version parser'.

The guard now requires exactly two leading spaces.

Fixes #32

extractPnpmPackageKey only checked that a line started with at least two spaces, so 6-space-indented scoped keys inside peerDependenciesMeta blocks were treated as package entries and produced garbage like name="    '@typescript-eslint" version="parser'".

Fixes #32
@andrew andrew merged commit 78f4944 into main May 22, 2026
5 checks passed
@andrew andrew deleted the fix-pnpm-peer-deps-meta branch May 22, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug in parsing pnpm-lock files

1 participant